package com.fs.dao.Impl;

import com.fs.dao.ClassPaperDao;
import com.fs.pojo.ClassPaper;
import com.fs.utils.JDBCUtils;

import java.util.List;

public class ClassPaperDaoImpl implements ClassPaperDao {


    @Override
    public List<ClassPaper> queryAllPapersByClassIdAndType(String classId, Integer type) {

        String sql = "select * from tb_class_paper where  class_id=? and type = ?";

        return JDBCUtils.executeQurey(sql,ClassPaper.class,classId,type);
    }

    @Override
    public ClassPaper queryById(String id) {
        return null;
    }

    @Override
    public List<ClassPaper> queryAll() {
        return null;
    }

    @Override
    public int insert(ClassPaper obj) {

        String sql = "insert tb_class_paper values (?,?,?,?,?,?,?,?)";
        return JDBCUtils.executeUpdate(sql,obj.getId(),obj.getClassId(),obj.getPaperId(),obj.getPublishName(),obj.getPublishTime(),obj.getDeadTime(),obj.getDuration(),obj.getType());
    }

    @Override
    public int deleteById(String id) {
        return 0;
    }

    @Override
    public int update(ClassPaper obj) { return 0; }
}
